//logs.js
const util = require('../../utils/util.js')
const common = require('../../utils/common')

Page({
  data: {
    logs: []
  },
  onShow() {

    // let rs = wx.getLaunchOptionsSync();
    // console.log(rs)
    // const appInstance = getApp();
    // console.log(appInstance.globalData)

    console.log(common.Hello(' xiaoming'))

  },
  onReady: function() {
    // 页面首次渲染完毕时执行
    console.log('on ready')
  },
  onHide(){
    console.log('hide ...')
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })

  },
  onUnload: function() {
    // 页面销毁时执行
    console.log(' on unload ')
  },
  onPullDownRefresh: function() {
    // 触发下拉刷新时执行
    console.log('onPullDownRefresh')
  },
  onReachBottom: function() {
    // 页面触底时执行
    console.log(' reach bottom')
  },
  onShareAppMessage: function () {
    // 页面被用户分享时执行
    console.log(' share message .')
  },
  onPageScroll: function(arg) {
    // 页面滚动时执行
    console.log('scroll ...',arg)
  },
  onResize: function() {
    // 页面尺寸变化时执行
    console.log('resize..')
  }
})